const express = require('express')
const navigationValidator = require('../validator/navigation')
const navigationCtrl = require('../controller/navigation')
const isAdminCheck = require('../middleware/isAdminCheck')

const router = express.Router()

//添加导航（管理员权限）
router.post('/navigation',isAdminCheck,navigationValidator.addNavigation,navigationCtrl.addNavigation)
//删除导航（管理员权限）
router.delete('/navigation/:id',isAdminCheck,navigationValidator.delNavigation,navigationCtrl.delNavigation)
//修改导航（管理员权限）
router.put('/navigation/:id', isAdminCheck, navigationValidator.updateNavigation, navigationCtrl.updateNavigation)
//获取导航
router.get('/navigations', navigationCtrl.getNavigationList)
// 获取导航（管理员权限）
router.get('/navigation/:id', navigationCtrl.getNavigationDetail)
module.exports = router
